package com.xyd.service.impl;

import com.xyd.dao.AdminMapper;
import com.xyd.bean.Admin;
import com.xyd.service.AdminService;
import com.xyd.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

public class AdminServiceImpl implements AdminService {
    SqlSession sqlSession= SqlSessionFactoryUtil.getSqlSession();
    AdminMapper adminMapper=sqlSession.getMapper(AdminMapper.class);
    @Override
    public Admin login(Admin admin) {
        Admin loginAdmin=null;
        try {
            loginAdmin = adminMapper.selectAdmin(admin);
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            sqlSession.close();
        }
        return loginAdmin;
    }
}
